/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import com.jeesite.common.mybatis.annotation.JoinTable;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

import java.math.BigDecimal;

/**
 * 物料档案Entity
 *
 * @author HOHD
 * @version 2020-12-16
 */
@Table(name = "st_material_record", alias = "a", columns = {
        @Column(name = "id", attrName = "id", label = "id", isPK = true),
        @Column(name = "material_code", attrName = "materialCode", label = "物料编号"),
        @Column(name = "material_name", attrName = "materialName", label = "物料名称", queryType = QueryType.LIKE),
        @Column(name = "material_type", attrName = "materialType", label = "物料类型"),
        @Column(name = "material_category", attrName = "materialCategory", label = "物料分类"),
        @Column(name = "specification", attrName = "specification", label = "规格型号"),
        @Column(name = "product_maker", attrName = "productMaker", label = "生产厂家"),
        @Column(name = "weigh_place", attrName = "weighPlace", label = "称重点"),
        @Column(name = "pack_type", attrName = "packType", label = "包装规格"),
        @Column(name = "default_warehouse", attrName = "defaultWarehouse", label = "默认仓位"),
        @Column(name = "single_price", attrName = "singlePrice", label = "单价"),
        @Column(name = "calc_unit", attrName = "calcUnit", label = "计量单位"),
        @Column(name = "sup_unit", attrName = "supUnit", label = "辅助单位"),
        @Column(name = "bar_code", attrName = "barCode", label = "条码号"),
        @Column(name = "low_inventory", attrName = "lowInventory", label = "最低库存"),
        @Column(name = "high_inventory", attrName = "highInventory", label = "最高库存"),
        @Column(name = "check_type", attrName = "checkType", label = "检验类型"),
        @Column(name = "sn_format", attrName = "snFormat", label = "sn格式"),
        @Column(name = "saved_type", attrName = "savedType", label = "保质期"),
        @Column(name = "effect", attrName = "effect", label = "有效"),
        @Column(name = "sn_manage", attrName = "snManage", label = "sn管理"),
        @Column(name = "batch_manage", attrName = "batchManage", label = "批号管理"),
        @Column(name = "remarks", attrName = "remarks", label = "备注", queryType = QueryType.LIKE),
}, orderBy = "a.id DESC", joinTable = {
        @JoinTable(on = "a.calc_unit=unit.id", type = JoinTable.Type.LEFT_JOIN, alias = "unit", attrName = "unitSetting1", entity = StUnitSetting.class),
        @JoinTable(on = "a.material_type=t.id", type = JoinTable.Type.LEFT_JOIN, alias = "t", attrName = "stMaterialType", entity = StMaterialType.class),
}
)
public class StMaterialRecord extends DataEntity<StMaterialRecord> {

    private static final long serialVersionUID = 1L;
    private String materialCode;        // 物料编号
    private String materialName;        // 物料名称
    private String materialType;        // 物料类型
    private StMaterialType stMaterialType;
    private Integer materialCategory;        // 物料分类
    private String specification;        // 规格型号
    private Integer productMaker;        // 生产厂家
    private Integer weighPlace;        // 称重点
    private String packType;        // 包装规格
    private String defaultWarehouse;        // 默认仓位

    private BigDecimal singlePrice;

    private StUnitSetting unitSetting1;
    private StSmallMaterialApprove smallMaterialApprove;

    private String calcUnit;        // 计量单位
    private String supUnit;        // 辅助单位
    private String barCode;        // 条码号
    private BigDecimal lowInventory;        // 最低库存
    private BigDecimal highInventory;        // 最高库存
    private Integer checkType;        // 检验类型
    private String snFormat;        // sn格式
    private Integer savedType;        // 保质期
    private Integer effect;        // 有效
    private Integer snManage;        // sn管理
    private Integer batchManage;        // 批号管理

    public StMaterialRecord() {
        this(null);
    }

    public StMaterialRecord(String id) {
        super(id);
    }

    public StMaterialType getStMaterialType() {
        return stMaterialType;
    }

    public void setStMaterialType(StMaterialType stMaterialType) {
        this.stMaterialType = stMaterialType;
    }

    public StUnitSetting getUnitSetting1() {
        return unitSetting1;
    }

    public void setUnitSetting1(StUnitSetting unitSetting1) {
        this.unitSetting1 = unitSetting1;
    }

    public StSmallMaterialApprove getSmallMaterialApprove() {
        return smallMaterialApprove;
    }

    public void setSmallMaterialApprove(StSmallMaterialApprove smallMaterialApprove) {
        this.smallMaterialApprove = smallMaterialApprove;
    }

    public BigDecimal getSinglePrice() {
        return singlePrice;
    }

    public void setSinglePrice(BigDecimal singlePrice) {
        this.singlePrice = singlePrice;
    }

    @Length(min = 0, max = 20, message = "物料编号长度不能超过 20 个字符")
    public String getMaterialCode() {
        return materialCode;
    }

    public void setMaterialCode(String materialCode) {
        this.materialCode = materialCode;
    }

    @Length(min = 0, max = 20, message = "物料名称长度不能超过 20 个字符")
    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    @Length(min = 0, max = 36, message = "物料类型长度不能超过 36 个字符")
    public String getMaterialType() {
        return materialType;
    }

    public void setMaterialType(String materialType) {
        this.materialType = materialType;
    }

    public Integer getMaterialCategory() {
        return materialCategory;
    }

    public void setMaterialCategory(Integer materialCategory) {
        this.materialCategory = materialCategory;
    }

    @Length(min = 0, max = 20, message = "规格型号长度不能超过 20 个字符")
    public String getSpecification() {
        return specification;
    }

    public void setSpecification(String specification) {
        this.specification = specification;
    }

    public Integer getProductMaker() {
        return productMaker;
    }

    public void setProductMaker(Integer productMaker) {
        this.productMaker = productMaker;
    }

    public Integer getWeighPlace() {
        return weighPlace;
    }

    public void setWeighPlace(Integer weighPlace) {
        this.weighPlace = weighPlace;
    }

    @Length(min = 0, max = 20, message = "包装规格长度不能超过 20 个字符")
    public String getPackType() {
        return packType;
    }

    public void setPackType(String packType) {
        this.packType = packType;
    }

    @Length(min = 0, max = 36, message = "默认仓位长度不能超过 36 个字符")
    public String getDefaultWarehouse() {
        return defaultWarehouse;
    }

    public void setDefaultWarehouse(String defaultWarehouse) {
        this.defaultWarehouse = defaultWarehouse;
    }

    @Length(min = 0, max = 36, message = "计量单位长度不能超过 36 个字符")
    public String getCalcUnit() {
        return calcUnit;
    }

    public void setCalcUnit(String calcUnit) {
        this.calcUnit = calcUnit;
    }

    @Length(min = 0, max = 36, message = "辅助单位长度不能超过 36 个字符")
    public String getSupUnit() {
        return supUnit;
    }

    public void setSupUnit(String supUnit) {
        this.supUnit = supUnit;
    }

    @Length(min = 0, max = 20, message = "条码号长度不能超过 20 个字符")
    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public BigDecimal getLowInventory() {
        return lowInventory;
    }

    public void setLowInventory(BigDecimal lowInventory) {
        this.lowInventory = lowInventory;
    }

    public BigDecimal getHighInventory() {
        return highInventory;
    }

    public void setHighInventory(BigDecimal highInventory) {
        this.highInventory = highInventory;
    }

    public Integer getCheckType() {
        return checkType;
    }

    public void setCheckType(Integer checkType) {
        this.checkType = checkType;
    }

    @Length(min = 0, max = 20, message = "sn格式长度不能超过 20 个字符")
    public String getSnFormat() {
        return snFormat;
    }

    public void setSnFormat(String snFormat) {
        this.snFormat = snFormat;
    }

    public Integer getSavedType() {
        return savedType;
    }

    public void setSavedType(Integer savedType) {
        this.savedType = savedType;
    }

    public Integer getEffect() {
        return effect;
    }

    public void setEffect(Integer effect) {
        this.effect = effect;
    }

    public Integer getSnManage() {
        return snManage;
    }

    public void setSnManage(Integer snManage) {
        this.snManage = snManage;
    }

    public Integer getBatchManage() {
        return batchManage;
    }

    public void setBatchManage(Integer batchManage) {
        this.batchManage = batchManage;
    }

}